package com.ruoyi.environment.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.utils.SecurityUtils;
import com.ruoyi.environment.mapper.OpmEnvParkWasteMapper;
import com.ruoyi.environment.domain.OpmEnvParkWaste;
import com.ruoyi.environment.service.IOpmEnvParkWasteService;

/**
 * 园区出渣Service业务层处理
 *
 * @author cjie
 * @date 2021-12-14
 */
@Service
public class OpmEnvParkWasteServiceImpl implements IOpmEnvParkWasteService {
    @Autowired
    private OpmEnvParkWasteMapper opmEnvParkWasteMapper;

    /**
     * 查询园区出渣
     *
     * @param id 园区出渣ID
     * @return 园区出渣
     */
    @Override
    public OpmEnvParkWaste selectOpmEnvParkWasteById(String id) {
        return opmEnvParkWasteMapper.selectOpmEnvParkWasteById(id);
    }

    /**
     * 查询园区出渣列表
     *
     * @param opmEnvParkWaste 园区出渣
     * @return 园区出渣
     */
    @Override
    public List<OpmEnvParkWaste> selectOpmEnvParkWasteList(OpmEnvParkWaste opmEnvParkWaste) {
        return opmEnvParkWasteMapper.selectOpmEnvParkWasteList(opmEnvParkWaste);
    }

    /**
     * 新增园区出渣
     *
     * @param opmEnvParkWaste 园区出渣
     * @return 结果
     */
    @Override
    public int insertOpmEnvParkWaste(OpmEnvParkWaste opmEnvParkWaste) {
        opmEnvParkWaste.setId(IdUtil.getSnowflake(0, 0).nextIdStr());
        opmEnvParkWaste.setCreateTime(DateUtils.getNowDate());
        opmEnvParkWaste.setCreateBy(SecurityUtils.getUsername());
        return opmEnvParkWasteMapper.insertOpmEnvParkWaste(opmEnvParkWaste);
    }

    /**
     * 修改园区出渣
     *
     * @param opmEnvParkWaste 园区出渣
     * @return 结果
     */
    @Override
    public int updateOpmEnvParkWaste(OpmEnvParkWaste opmEnvParkWaste) {
        return opmEnvParkWasteMapper.updateOpmEnvParkWaste(opmEnvParkWaste);
    }

    /**
     * 批量删除园区出渣
     *
     * @param ids 需要删除的园区出渣ID
     * @return 结果
     */
    @Override
    public int deleteOpmEnvParkWasteByIds(String[] ids) {
        return opmEnvParkWasteMapper.deleteOpmEnvParkWasteByIds(ids);
    }

    /**
     * 删除园区出渣信息
     *
     * @param id 园区出渣ID
     * @return 结果
     */
    @Override
    public int deleteOpmEnvParkWasteById(String id) {
        return opmEnvParkWasteMapper.deleteOpmEnvParkWasteById(id);
    }
}
